home *** CD-ROM | disk | FTP | other *** search
/ The X-Philes (2nd Revision) / The X-Philes Number 1 (1995).iso / xphiles / hp48hor2 / mldl1069.txt < prev    next >
Text File  |  1995-03-31  |  64KB  |  1,562 lines

  1. DOC 1.1 -- Documentation for MLDL106A/B.LIB in the HACKER directory 
  2. ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ 
  3. NOTE!  This is a plain ASCII text file containing multiple 
  4. documents. You may find it most convenient to view or print this file 
  5. by running the DOC.EXE program (supplied on this disk) on your PC. 
  6. This is the first Goodies Disk to do it this way.  Hope you like it. 
  7. ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ 
  8. :GD9 
  9. :MLDL 1.06 A/B 
  10. :-jkh- 
  11. @@MLDL 1.06 A/B 
  12. MLDL 1.06A/B, OCTOBER 1991  -- S/SX ONLY! 
  13. ííííííííííííííííííííííííííííííííííííííííí 
  14. Machine Language Development Library 
  15. by Jan Brittenson 
  16.  
  17. This entire document is for a single library in the 
  18. HACKER directory, of which there are two versions: 
  19.  
  20. MLDL106A.LIB 
  21. MLDL106B.LIB 
  22.  
  23. This is an improved version of the MLDL on Goodies Disk 
  24. #3, with much more complete documentation. Note that 
  25. there are two versions, the A version which runs from RAM 
  26. only, and does not work if it's in a ROM or 
  27. write-protected RAM card; and the B version, which ONLY 
  28. works in a ROM or write-protected RAM card (this version 
  29. used to be a commercial product but was recently placed 
  30. in the public domain). Otherwise the A and B versions 
  31. are identical. Use the appropriate one. If you try to 
  32. use one and get a "Fatal Error: Card Failure" message, 
  33. then try the other one. -jkh- 
  34.  
  35.    The MLDL is a Machine Language Development Library for 
  36. the HP-48SX, and as such is primarily intended for HP-48 
  37. Machine-Language Programmers familiar with the following: 
  38.  
  39.         o  The Saturn instruction set 
  40.  
  41.         o  Assembler programming 
  42.  
  43.         o  Machine code debugging 
  44.  
  45.         o  RPL internals - GC (Garbage Collection); 
  46.            system RPL; PMC (Prefixed Machine Code) 
  47.  
  48. The MLDL disassembles HP48 machine language into assembly 
  49. language using AG mnemonics, not HP mnemonics. AG 
  50. mnemonics are named after Alonzo Gariepy, who designed 
  51. his mnemonic vocabulary explicitly to resemble the 
  52. mnemonics of other commonly used processors. Hewlett 
  53. Packard also has a set of mnemonics, described in files 
  54. bundled with their unsupported development tools [Goodies 
  55. Disk #4  -jkh-]. The HP mnemonics set and assembler 
  56. syntax do not adhere to a source-destination model. 
  57. Instructions sometimes span over several lines, it is 
  58. column-oriented, and is by some people perceived as 
  59. somewhat unfriendly. 
  60.  
  61. [If you are more used to the HP mnemonics, see the 
  62. ROSETTA.DOC file in the HACKER directory on this disk; it 
  63. is a complete AG <--> HP translation table. Use LIST.COM 
  64. to view and/or print it. -jkh-] 
  65.  
  66. Thanks to Alonzo Gariepy for his restructuring of the 
  67. Saturn instruction set, to Rick Grevelle and Joe Ervin 
  68. for their continuous testing and helpful advice, and to 
  69. everyone near and far who has contributed  to charting 
  70. the HP48 internals. 
  71. @@Installing 
  72. INSTALLING THE LIBRARY 
  73. íííííííííííííííííííííí 
  74.  
  75.    The MLDL consists of five named commands, and has been 
  76. given the number 1092 decimal (hexadecimal 444). To 
  77. install it, transfer the A or B version of the binary 
  78. file to your calculator and store it in a suitable port. 
  79. Turn the calculator off, then back on. It will 
  80. automatically attach to the HOME directory. 
  81.  
  82. To remove it, go to the directory where you previously 
  83. attached it, enter `:p:1092', press DUP DETACH, then 
  84. PURGE. The library does not automatically attach. 
  85.  
  86.    The display will flicker once as the library gets 
  87. purged from the port. 
  88. @@Commands 
  89. LIBRARY COMMANDS 
  90. íííííííííííííííí 
  91.  
  92. The MLDL library contains five commands: 
  93.  
  94. ABOUTMLDL ============================ the "about" screen 
  95. MLDB ============== interactive Machine Language DeBugger 
  96. MLPR ====== Machine Language PRint disassembly (ON exits) 
  97. ML1 ==== Machine Language disassembly, 1 instruction only 
  98. MLOPC =========================== Machine Language OPCode 
  99.  
  100. These five commands are described in detail below. 
  101. Note: they have equal signs (==) next to them in the DOC 
  102. viewer's selection column for quick identification. 
  103. @@ABOUTMLDL==== 
  104. [ABOUTMLDL] ============================================= 
  105.  
  106. Displays version and copyright. [Note: Jan released MLDL 
  107. to the public domain; it may be freely copied. -jkh-] 
  108. @@MLDB========= 
  109. [MLDB] ================================================== 
  110.  
  111.    HP48 ML Debugger. This description covers the MLDB 
  112. local mode. It can also operate in one of two server 
  113. modes: interactive or protocol, described under MLDB 
  114. Server Modes below. In Local Mode, the HP-48 display and 
  115. keyboard, are used to control the debugger. In Server 
  116. Mode, control is maintained via the serial port, either 
  117. from a dumb ASCII terminal (Interactive Mode), or a 
  118. dedicated front-end (Protocol Mode). To insure that MLDB 
  119. is in Local Mode when invoked, clear user flags 32 and 
  120. 33: 
  121.  
  122.         32 33 CF CF 
  123.  
  124.    MLDB allows you single-step ML programs, as well as 
  125. examine registers and memory contents. Since it 
  126. single-steps ML, it is not useful for debugging RPL code 
  127. -- unless you wish to follow your RPL thread on an ML 
  128. level. 
  129.  
  130. When invoked, an argument in expected in level 1: 
  131.  
  132.         Global name (variable) 
  133.  
  134.                 The value of the global name is 
  135.             recursively used as an argument. Caution: The 
  136.             value can be another global name, whose value 
  137.             is then used in turn. If the variable's value 
  138.             is its own name, and endless recursion will 
  139.             occur. Such a recursion can be aborted woth 
  140.             ON-C. 
  141.  
  142.         Code object 
  143.  
  144.                 MLDB halts before the first instruction 
  145.             of the code object. Both the PC and A 
  146.             registers are set to the address of the first 
  147.             instruction. 
  148.  
  149.         XLIB 
  150.  
  151.                The XLIB must be a code object, which 
  152.             becomes the argument. 
  153.  
  154.         Binary integer 
  155.  
  156.                 MLDB treats the binary integer as the 
  157.             address of a prefixed machine code routine 
  158.             (PMC). It halts at the first instruction of 
  159.             the PMC. PMCs consist of a 5-nibble pointer 
  160.             to the first instruction which is usually, 
  161.             but not always, the address of the PMC plus 
  162.             5. 
  163.              
  164.         @#3a81 (True) 
  165.  
  166.                 If the token following the MLDB 
  167.             invocation is a code object, MLDB halts at 
  168.             its first instruction. Any other type of 
  169.             object results in an error. When the code 
  170.             object completes, RPL execution continues 
  171.             with the next consecutive word. When the 
  172.             argument is @#3ac0 (False), the invocation of 
  173.             MLDB is ignored, so the invocation can be 
  174.             preceded by a test -- for instance a user 
  175.             flag test, which permits the debugging of 
  176.             individual machine language objects embedded 
  177.             in RPL programs to be turned on and off by 
  178.             setting user flags. 
  179.  
  180.         Any object other than @#3a81 
  181.  
  182.                 Other objects are ignored -- the debugger 
  183.             returns immediately. Included here is @#3ac0 
  184.             (False). 
  185. @@The 8 Screens 
  186. The 8 Screens 
  187. ííííííííííííí 
  188.  
  189.    The Local Mode MLDB uses PICT (the graphical display) 
  190. to present information. Since all information will not 
  191. fit on one display at once, it has been divided into 8 
  192. screens. Only one screen is active at any one time. 
  193. Switching between screens is done by means of the 6 menu 
  194. keys, here referred to as A-F, which correspond to screen 
  195. 1 through 6 respectively, and the MTH and VAR keys, which 
  196. correspond to screens 7 and 8. 
  197.  
  198.    The sample screens 1-8 below are from the PMC at 
  199. #59CC, and can be approximately reproduced by: 
  200.  
  201.         #59CCh MLDB 
  202.  
  203.     Note: some MLDL commands (viz. MLDB, ML1, and MLPR) 
  204.     automatically create an 'MLDLpar' variable in the 
  205.     HOME directory. It contains configuration data and 
  206.     variables used. It is about 650 bytes. Depending on 
  207.     the number of directories and variables in the HP48, 
  208.     a significant gain in speed can be achieved by 
  209.     reordering the HOME directory so the 'MLDLpar' 
  210.     variable appears last in the VAR menu. See the ORDER 
  211.     command in your HP48 manual for details on how to do 
  212.     this. 
  213.  
  214. Note: The 8 screens have "°" characters next to them in 
  215. the DOC viewer's selection column for quick 
  216. identification. 
  217. @@CPU State   ° 
  218. Screen 1  - General CPU State (key [A]) 
  219.  
  220.                                  úÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ 
  221. Mnemonic........................ 3CALL.4 #0679B         3 
  222. Opcode.......................... 3 8E4CD0               3 
  223. PC, P, Carry, Hex/Dec mode, ST.. 3@:059D1 P:0 CH ST:218 3 
  224. A.A and C.A..................... 3A:000CC C:77794       3 
  225. B.A, D.A, and HST............... 3B:729A9 D:00F96 HST:2 3 
  226. D0 and 6 bytes @D0.............. 3D0:409C1/9540A8240BC9 3 
  227. D1 and 6 bytes @D1.............. 3D1:77799/000000000000 3 
  228. Top 3 levels of RSTK............ 3RST:00000:00000:00000 3 
  229.                                  àÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄù 
  230. Notes: 
  231.  
  232. "Mnemonic" is the current instruction, pointed to by the 
  233. PC (program counter). "Opcode" is the current machine 
  234. language instruction, in hex. The third line is the 
  235. current PC, P register, the status of the carry bit (a C 
  236. if carry is set, and a blank if clear), current hex/dec 
  237. mode (D = DEC mode, H = HEX mode) as set by the SETDEC 
  238. and SETHEX instructions, and the low three nibbles of the 
  239. ST register. These three lines are common to many of the 
  240. MLDB screens described below. 
  241.  
  242. Lines four and five are the low five nibbles (the .A 
  243. field) of the A, B, C, and D registers, as well as the 
  244. HST register. Lines six and seven are the D0 and D1 
  245. registers, as well as the contents of the addresses that 
  246. they point to, as 12-nibble integers. The address 
  247. pointed to by them is displayed as the rightmost digit, 
  248. with the next higher address pointing to the digit to its 
  249. left, and so on. This seems "backwards", but is done 
  250. this way because the Saturn CPU stores integers in memory 
  251. with the least significant digit (nibble) at the lowest 
  252. address, and the most significant digit at the highest 
  253. address, thus it is usually handier to view memory 
  254. contents backwards like this. 
  255.  
  256. The bottom line is common to several of the screens 
  257. described below. It contains the top three RSTK (return 
  258. stack) levels. 
  259. @@Main Regs   ° 
  260. Screen 2  - Arithmetic registers (key [B]) 
  261.  
  262.                                  úÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ 
  263. Mnemonic........................ 3CALL.4 #0679B         3 
  264. Opcode.......................... 3 8E4CD0               3 
  265. PC, P, Carry, Hex/Dec mode, ST.. 3@:059D1 P:0 CH ST:218 3 
  266. Register A...................... 3A:00000005444000CC    3 
  267. Register B...................... 3B:000000000007611E    3 
  268. Register C...................... 3C:000000000007792C    3 
  269. Register D...................... 3D:00000000000004D0    3 
  270. Top 3 levels of RSTK............ 3RST:00000:00000:00000 3 
  271.                                  àÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄù 
  272.  
  273. Lines 4 to 7 are registers A, B, C, and D respectively. 
  274. All 16 nibbles (64 bits) are displayed. 
  275. @@Scratch Regs° 
  276. Screen 3  - Data registers (key [C]) 
  277.  
  278.                                  úÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ 
  279. Mnemonic........................ 3CALL.4 #0679B         3 
  280. Opcode.......................... 3 8E4CD0               3 
  281. PC, P, Carry, Hex/Dec mode, ST.. 3@:059D1 P:0 CH ST:218 3 
  282. Register R0..................... 3R0:053385D439800040   3 
  283. Register R1..................... 3R1:00000005444059D1   3 
  284. Register R2..................... 3R2:0000000000075BC1   3 
  285. Register R3..................... 3R3:0000000544402E92   3 
  286. Register R4..................... 3R4:00015075A6375AA1   3 
  287.                                  àÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄù 
  288.  
  289. Lines 4 to 8 are registers R0, R1, R2, R3, and R4 
  290. respectively. All 16 nibbles (64 bits) are displayed. 
  291. @@Return Stack° 
  292. Screen 4  - Return stack (key [D]) 
  293.  
  294.                                  úÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ 
  295. Mnemonic........................ 3CALL.4 #0679B         3 
  296. Opcode.......................... 3 8E4CD0               3 
  297. PC, P, Carry, Hex/Dec mode, ST.. 3@:059D1 P:0 CH ST:218 3 
  298.                                  3                      3 
  299. RSTK levels 0 and 4............. 3RST0:00000 RST4:00000 3 
  300. RSTK levels 1 and 5............. 3RST1:00000 RST5:00000 3 
  301. RSTK levels 2 and 6............. 3RST2:00000 RST6:00000 3 
  302. RSTK levels 3 and 7............. 3RST3:00000 RST7:00000 3 
  303.                                  àÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄù 
  304.  
  305. Lines 5 to 8 are the eight levels of RSTK, displayed as 
  306. 5-nibble integers. RSTK0 is the top of the stack, and is 
  307. the most recent return address (or value most recently 
  308. PUSHed there). 
  309. @@Memory Dump ° 
  310. Screen 5  - Memory dump (key [E]) 
  311.  
  312.                                  úÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ 
  313. Locations 59A0-59AF............. 3059A0:56113680913420CC3 
  314. Locations 59B0-59BF............. 3059B0:4E0156716FCC56FD3 
  315. Locations 59C0-59CF............. 3059C0:015B38D5E0101D953 
  316. Locations 59D0-59DF............. 3059D0:08E4CD08E46C01013 
  317. Locations 59E0-59EF............. 3059E0:D2305749111914433 
  318. Locations 59F0-59FF............. 3059F0:4E4A2011013114563 
  319. Locations 5A00-5A0F............. 305A00:12280A50143174E73 
  320. Locations 5A10-5A1F............. 305A10:8E58D013117414313 
  321.                                  àÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄù 
  322.  
  323. The 128 addresses surrounding the current PC are 
  324. displayed, with the line corresponding to the current PC 
  325. at the center. The location of the current instruction is 
  326. indicated by an inverse digit (in this example, the "8" 
  327. at address 059D1). Each line is 16 nibbles, with the 
  328. leftmost nibble corresponding to the lowest address 
  329. ("frontwards" order). The memory dump can be shifted one 
  330. nibble using the [CST] 4 option (see Option 4, below). 
  331. @@Instructions° 
  332. Screen 6  - ML Instruction Stream (key [F]) 
  333.  
  334.                                  úÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ 
  335. PC, P, Carry, Hex/Dec mode, ST.. 3@:059D1 P:0 CH ST:218 3 
  336. Next 7 instructions............. 3°CALL.4°°0679B°°°°°°°°3 
  337.                                  3 CALL.4 #06641        3 
  338.                                  3 MOVE.W A,R1          3 
  339.                                  3 CLR.A C              3 
  340.                                  3 MOVE.P1 #5,C         3 
  341.                                  3 CALL.3 #05B7D        3 
  342.                                  3 MOVE.W R1,C          3 
  343.                                  àÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄù 
  344.  
  345. The top line is the current PC, P register, the status of 
  346. the carry bit, HEX/DEC mode, and the low three nibbles of 
  347. the ST register. 
  348.  
  349. The remaining seven lines are the seven subsequent 
  350. instructions, with the next instruction to be executed 
  351. always appearing in reverse video at the top of the 
  352. screen (here somewhat crudely illustrated with the ° 
  353. character.) 
  354. @@Breakpoints ° 
  355. Screen 7  - Breakpoint Table Screen (key MTH) 
  356.  
  357.                                  úÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ 
  358. Breakpoint #1................... 3 1:6100 +02           3 
  359. Breakpoint #2................... 3 2:6104 -02           3 
  360. Breakpoint #3................... 3 3:613A  00           3 
  361. Breakpoints #4-#8: not set...... 3 4:0000  00           3 
  362.                                  3 5:0000  00           3 
  363.                                  3 6:0000  00           3 
  364.                                  3 7:0000  00           3 
  365.                                  3 8:0000  00           3 
  366.                                  àÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄù 
  367.  
  368. Each line corresponds to one breakpoint. There are eight 
  369. breakpoints, each consisting of an address and a counter. 
  370. The address is displayed immediately following the 
  371. breakpoint number. Trailing each line is the breakpoint 
  372. counter, a signed 2-nibble (8-bit) hex integer. Any 
  373. breakpoints at the current location are displayed in 
  374. reverse video. 
  375. @@Watchpoints ° 
  376. Screen 8  - Watchpoint Table Screen (key VAR) 
  377.  
  378.                                  úÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ 
  379. Watchpoint #1................... 300138:9DEF0C1085D1BF213 
  380. Watchpoint #2................... 301400:8F235A05C965E1863 
  381. Watchpoint #3................... 3FFFFF:12369B108DADF1003 
  382. Watchpoint #4................... 370000:F3C5A0000FB13FB33 
  383. Watchpoints #5-#8: not set...... 300000:2369B108DADF10083 
  384.                                  300000:2369B108DADF10083 
  385.                                  300000:2369B108DADF10083 
  386.                                  300000:2369B108DADF10083 
  387.                                  àÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄù 
  388.  
  389. Each line corresponds to a watchpoint. A watchpoint can 
  390. be set to any arbitrary address. The display format is 
  391. consistent with the format of the memory dump screen. 
  392. @@Annunciators 
  393. The HP48 Annunciators 
  394. ííííííííííííííííííííí 
  395.  
  396. The display annunciators are left undisturbed by the 
  397. local mode MLDB. If in server mode, only the I/O 
  398. annunciator (the arrow in the upper right corner of the 
  399. display) is used; it will flicker with each character 
  400. received over the serial line. The annunciators are left 
  401. in whatever state the HP48 ROM put them in, which means 
  402. that the busy annunciator is usually lit and all other 
  403. annunciators are turned off. For all practical purposes, 
  404. as far as the HP48 ROM is concerned a system RPL program 
  405. is executing, even if it is temporarily halted between 
  406. instructions by MLDB. 
  407.  
  408. The local mode MLDB puts the Saturn microprocessor in 
  409. light sleep between keystrokes, which means that battery 
  410. consumption is generally low even if the busy annunciator 
  411. is lit. Light sleep is not used when in server mode, 
  412. which always runs at full power. 
  413. @@Local Kbd 
  414. The Local Mode MLDB keyboard 
  415. íííííííííííííííííííííííííííí 
  416.  
  417.    A number of keys will accept an argument, referred to 
  418. as ARG. To enter ARG, press [0] (the zero key) followed 
  419. by a hex number, which will make up ARG. It is restricted 
  420. to 5 hex digits (20 bits). When [0] is pressed, the 
  421. bottom display line, regardless of which screen is 
  422. currently active, becomes an ARG entry line: 
  423.  
  424.         3ARG:00000             3 
  425.         àÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄù 
  426.  
  427.    This remains in effect until a non-hex key is pressed, 
  428. at which point that key is executed. Some keys behave 
  429. differently depending on whether ARG was present. [DEL], 
  430. for instance, does nothing, effectively cancelling ARG. 
  431. The backarrow, [<==], divides the argument by 16, in 
  432. effect shifting it right one digit. The argument is 
  433. always a 20-bit unsigned integer. The digits A-F are 
  434. found on the menu keys. The [+/-] key negates (2's 
  435. complement) the argument. 
  436.  
  437.  
  438. Example, ARG entry: 
  439.  
  440. Keys           Comments        Bottom line following keys 
  441. ÄÄÄÄ           ÄÄÄÄÄÄÄÄ        ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ 
  442. 0              Start entry     3ARG:00000             3 
  443. 5              Digit 5         3ARG:00005             3 
  444. 7              Digit 7         3ARG:00057             3 
  445. [<==]          Shift right     3ARG:00005             3 
  446. 9              Digit 9         3ARG:00059             3 
  447. D1             Digits D, 1     3ARG:059D1             3 
  448. [+/-]          Negate          3ARG:FA62F             3 
  449. 000            Three 0s        3ARG:2F000             3 
  450. [<==]          Shift right     3ARG:02F00             3 
  451. [DEL]          Cancel ARG 
  452. @@Moving Around 
  453. Moving Around in Memory 
  454. ííííííííííííííííííííííí 
  455.  
  456. Moving around is done with the arrow keys and the NXT 
  457. key. Notice that none of these keys actually execute the 
  458. previous instruction; only the PC is affected: 
  459.  
  460.         [up]    Decrement PC by 16 (or 16*ARG) 
  461.         [down]  Increment PC by 16 (or 16*ARG) 
  462.         [left]  Decrement PC by 1 (or ARG) 
  463.         [right] Increment PC by 1 (or ARG) 
  464.         [NXT]   Move to next instruction (or ARG 
  465.                 instructions forward) 
  466.         [ENTER] Set PC to ARG 
  467.  
  468. In addition, there is a "mark": 
  469.  
  470.         [x]     (Multiplication key) 
  471.                 Set mark to ARG, if present. Otherwise 
  472.                 the MARK is set to the current PC. 
  473.  
  474.         [+/-]   Swaps the PC and the mark. 
  475.  
  476.  
  477.  
  478. Example, Moving Around: 
  479.  
  480. Keys            Effect           Display following keys 
  481. ÄÄÄÄ            ÄÄÄÄÄÄ          ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ 
  482.  
  483.    First, set the PC to 059D1: 
  484.                                 úÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ 
  485. 059D1[ENTER]    PC=#059D1h      3@:059D1 P:0 CH ST:218 3 
  486.                                 3°CALL.4°°0679B°°°°°°°°3 
  487.                                 3 CALL.4 #06641        3 
  488.                                 3 MOVE.W A,R1          3 
  489.                                 3 CLR.A C              3 
  490.                                 3 MOVE.P1 #5,C         3 
  491.                                 3 CALL.3 #05B7D        3 
  492.                                 3 MOVE.W R1,C          3 
  493.                                 àÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄù 
  494.  
  495.    Move 4 nibbles forward: 
  496.                                 úÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ 
  497. 04[right]       PC=PC+4         3@:059D5 P:0 CH ST:218 3 
  498.                                 3°CLR.A°A°°°°°°°°°°°°°°3 
  499.                                 3 CALL.4 #06641        3 
  500.                                 3 MOVE.W A,R1          3 
  501.                                 3 CLR.A C              3 
  502.                                 3 MOVE.P1 #5,C         3 
  503.                                 3 CALL.3 #05B7D        3 
  504.                                 3 MOVE.W R1,C          3 
  505.                                 àÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄù 
  506.    Notice that we didn't really advance the PC by one 
  507.    full instruction, which means that the PC now points 
  508.    two nibbles into the offset of the previous CALL 
  509.    instruction. 
  510.  
  511.    Set the PC back to 059D1 and switch to the memory 
  512.    screen: 
  513.                                 úÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ 
  514. 059D1[ENTER]    PC=#059D1       3059A0:56113680913420CC3 
  515.                                 3059B0:4E0156716FCC56FD3 
  516. [E]             Memory dump,    3059C0:015B38D5E0101D953 
  517.                 screen 5        3059D0:0°E4CD08E46C01013 
  518.                                 3059E0:D2305749111914433 
  519.                                 3059F0:4E4A2011013114563 
  520.                                 305A00:12280A50143174E73 
  521.                                 305A10:8E58D013117414313 
  522.                                 àÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄù 
  523.  
  524.    Move 16 nibbles back: 
  525.                                 úÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ 
  526. [up]            PC=PC-#10h      305990:3A6E80D0F40D4F013 
  527.                                 3059A0:56113680913420CC3 
  528.                                 3059B0:4E0156716FCC56FD3 
  529.                                 3059C0:0°5B38D5E0101D953 
  530.                                 3059D0:08E4CD08E46C01013 
  531.                                 3059E0:D2305749111914433 
  532.                                 3059F0:4E4A2011013114563 
  533.                                 305A00:12280A50143174E73 
  534.                                 àÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄù 
  535.  
  536.    Set the PC back to 059D1 and switch to the 
  537.    Instructions screen: 
  538.                                 úÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ 
  539. 059D1[ENTER]    Back to #59D1h  3@:059D1 P:0 CH ST:218 3 
  540.                                 3°CALL.4°°679B°°°°°°°°°3 
  541. [F]             ML instructions 3 CALL.4 #06641        3 
  542.                                 3 MOVE.W A,R1          3 
  543.                                 3 CLR.A C              3 
  544.                                 3 MOVE.P1 #5,C         3 
  545.                                 3 CALL.3 #05B7D        3 
  546.                                 3 MOVE.W R1,C          3 
  547.                                 àÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄù 
  548.  
  549.    Jump to next instruction: 
  550.                                 úÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ 
  551. [NXT]           Forward one     3@:059D7 P:0 CH ST:218 3 
  552.                 instruction     3°CALL.4°°06641°°°°°°°°3 
  553.                                 3 MOVE.W A,R1          3 
  554.                                 3 CLR.A C              3 
  555.                                 3 MOVE.P1 #5,C         3 
  556.                                 3 CALL.3 #05B7D        3 
  557.                                 3 MOVE.W R1,C          3 
  558.                                 3 MOVE.A C,@D0         3 
  559.                                 àÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄù 
  560.  
  561.    Set the mark and advance three instructions: 
  562.                                 úÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ 
  563. [x]             Set mark        3@:059D7 P:0 CH ST:218 3 
  564.                                 3°MOVE.P1°°5,C°°°°°°°°°3 
  565. 03[NXT]         Forward 3       3 CALL.3 #05B7D        3 
  566.                 instructions    3 MOVE.W R1,C          3 
  567.                                 3 MOVE.A C,@D0         3 
  568.                                 3 MOVE.P5 #02A4E,C     3 
  569.                                 3 MOVE.W R0,A          3 
  570.                                 3 MOVE.A A,D1          3 
  571.                                 àÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄù 
  572.  
  573.    Swap the mark and the PC: 
  574.                                 úÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ 
  575. [+/-]           Toggle mark,    3@:059D7 P:0 CH ST:218 3 
  576.                 PC              3°CALL.4°°06641°°°°°°°°3 
  577.                                 3 MOVE.W A,R1          3 
  578.                                 3 CLR.A C              3 
  579.                                 3 MOVE.P1 #5,C         3 
  580.                                 3 CALL.3 #05B7D        3 
  581.                                 3 MOVE.W R1,C          3 
  582.                                 3 MOVE.A C,@D0         3 
  583.                                 àÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄù 
  584.  
  585.    The arrow keys are most useful for moving around in 
  586. the memory dump, but can also be used to arbitrarily 
  587. increment and decrement the PC to shift the instruction 
  588. stream by single nibbles. The mark commands are useful 
  589. for temporarily remembering an address that you wish to 
  590. return to later. 
  591. @@Quit 
  592. Terminating the Program 
  593. ííííííííííííííííííííííí 
  594.  
  595.    There are four ways to leave the MLDB. The first two 
  596. listed below continue RPL execution at the next token in 
  597. the thread. If invoked from the LIBRARY MLDL menu, 
  598. control is returned to normal calculator operation. The 
  599. third method of leaving the MLDB, also listed below, 
  600. warmstarts the calculator by performing a system reset 
  601. (no variables are lost; same as ON-C). The fourth method 
  602. is to allow the program to run to completion by pressing 
  603. EVAL (described in the next section). 
  604.  
  605.         [<==]   (Delete key) 
  606.                 Exits. 
  607.  
  608.         [DEL]   Restores system registers to the state 
  609.                 they were in when the debugger was 
  610.                 entered. This is useful if you would need 
  611.                 to exit in the middle of your program and 
  612.                 the system registers contain random data. 
  613.                 It does nothing if ARG was supplied, in 
  614.                 effect acting as an ARG cancellation key. 
  615.  
  616.         [1/X] [1/X] 
  617.                 Panic exit. If you know the machine will 
  618.                 crash when you exit, such as could be the 
  619.                 case if memory has been reconfigured or 
  620.                 trashed. Resets the calculator by a "warm 
  621.                 start" (same as ON-C; no variables are 
  622.                 lost). 
  623. @@SST & Run 
  624. Program Stepping and Running 
  625. íííííííííííííííííííííííííííí 
  626.  
  627. The program can either be single-stepped instruction by 
  628. instruction, or allowed to run free, which means that the 
  629. program will run without interference until it completes 
  630. or encounters a breakpoint. Single-stepping can be either 
  631. shallow or deep. A shallow step is one where CALLs are 
  632. stepped as a single instruction (similar to the SST 
  633. command). A deep step follows CALLs into subroutines 
  634. (similar to the SST  command). Both shallow and deep 
  635. stepping can be given ARGs, in which case the ARG 
  636. determines the number of instructions to be stepped. If 
  637. multiple instructions are stepped, then they are 
  638. susceptible to breakpoints. The table below lists the 
  639. keys that control program execution. 
  640.  
  641. A single-step of more than one instruction is sensitive 
  642. to the ON key. Pressing ON during a single-step of more 
  643. than one instruction will halt execution. During 
  644. execution, PICT is displayed unless it has been purged, a 
  645. behavior which can be disabled (see Option 5, below). 
  646.  
  647.         [+]     Deep Single-steps one (or ARG) 
  648.                 instruction(s), pointed to by the PC. 
  649.                 Follows CALLs. If ARG, then also checks 
  650.                 for breakpoints and displays PICT until 
  651.                 done. 
  652.  
  653.         [-]     Shallow Single-steps one (or ARG) 
  654.                 instruction(s). Same as [+], but does 
  655.                 not follows CALLs; instead, the program 
  656.                 halts when it returns from the CALL. 
  657.                 Subroutines are single-stepped as if they 
  658.                 were single instructions. 
  659.  
  660.         [.]     Redraws the display but otherwise does 
  661.                 nothing. 
  662.  
  663.         [EEX]   Display PICT until released. 
  664.  
  665.         [EVAL]  Continue execution, running until program 
  666.                 completes, breakpoint is reached, or a 
  667.                 broken [-] CALL execution completes. 
  668.                 Displays PICT while program runs. 
  669.  
  670. Example, Program Completion: 
  671.  
  672.            Start with the stack display, in HEX mode, in 
  673.         the LIBRARY MLDL menu. Only the relevant lines of 
  674.         the stack display are included in the example 
  675.         below. #3244h is the address of the System RPL 
  676.         DROP command. 
  677.  
  678.                                          
  679. Keys            Comments         Display following keys 
  680. ÄÄÄÄ            ÄÄÄÄÄÄÄÄ        ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ 
  681.  
  682. HEX STD         Set up modes 
  683.  
  684.  
  685. 2 1 #3244h      Enter two dummy 33:                   23 
  686. [ENTER]         arguments for   32:                   13 
  687.                 DROP, and the   31:             # 3244h3 
  688.                 address of the  àÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄù 
  689.                 DROP command 
  690.  
  691.  
  692.                                 úÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ 
  693. [MLDB]          Invoke MLDB on  3@:03249 P:0  H ST:218 3 
  694. [F]             the DROP PMC    3#ADD.A##5,D1##########3 
  695.                 and choose the  3 INC.A D              3 
  696.                 instruction     3 MOVE.A @D0,A         3 
  697.                 screen          3 ADD.A #5,D0          3 
  698.                                 3 JUMP.A @A            3 
  699.                                 3 MOVE.A C,B           3 
  700.                                 3 MOVE.1 #3,P          3 
  701.                                 àÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄù 
  702.  
  703.    The DROP PMC consists of only the first 5 instructions. 
  704. Executing the JUMP @A instruction will cause the program 
  705. to reach completion. Allow the program to complete 
  706. without interference: 
  707.  
  708. [EVAL]          Allow program   31:                   23 
  709.                 to run freely;  àÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄù 
  710.                 the 1 is dropped. 
  711. @@Breakpoints 
  712. Breakpoints 
  713. ííííííííííí 
  714.  
  715.    The MLDB maintains a breakpoint table of eight slots. 
  716. Each slot consists of an address and a counter, both of 
  717. which are displayed when the MTH key is pressed (see 
  718. below). The address is 20 bits and the counter is eight 
  719. bits. Breakpoints only work in RAM, although they can be 
  720. set in ROM and triggered by multi-instruction 
  721. single-steps. 
  722.  
  723.     When a breakpoint is triggered, its counter is 
  724. incremented; if after the increment it is negative 
  725. (80-FF), the program will continue. Setting a negative 
  726. counter is therefore a way of instructing MLDB to "ignore 
  727. this breakpoint N times" where N is in the range 01-7F 
  728. hexadecimal. If the counter is positive, the program is 
  729. halted with a "Breakpoint Stop" or "Breakpoint Trap" 
  730. message, depending on whether the breakpoint was 
  731. triggered during a single-step or free run, respectively. 
  732. Positive counters indicate how many times the program has 
  733. halted at a specific breakpoint. 
  734.  
  735. Breakpoints are accessible via three keys: 
  736.  
  737.  
  738.         [MTH]   Switch to breakpoint table screen. Any 
  739.                 entry at the current PC will be displayed 
  740.                 in reverse video. 
  741.  
  742.         [PRG]   Set breakpoint address. Waits for a 
  743.                 further key, 1-8, which specifies the 
  744.                 breakpoint whose address is to be set. 
  745.                 ARG is the new address value. If no ARG 
  746.                 is entered, then the entire breakpoint is 
  747.                 cleared (its address and counter are both 
  748.                 zeroed out). 
  749.  
  750.         [STO]   Set breakpoint counter. Waits for a 
  751.                 further key, 1-8, which specifies the 
  752.                 breakpoint whose counter is to be set. 
  753.                 ARG is the new counter value. The counter 
  754.                 is cleared if no ARG is entered. Only the 
  755.                 low 8 bits of ARG are used. 
  756.  
  757. Example, Breakpoints: 
  758.  
  759. Keys            Comments         Display following keys 
  760. ÄÄÄÄ            ÄÄÄÄÄÄÄÄ        ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ 
  761.  
  762.                                 úÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ 
  763. 059D1[ENTER]    PC=59D1         3CALL.4 #0679B         3 
  764. [A]             Screen 1        3 8E4CD0               3 
  765.                                 3@:059D1 P:0 CH ST:218 3 
  766.                                 3A:000CC C:77794       3 
  767.                                 3B:729A9 D:00F96 HST:2 3 
  768.                                 3D0:409C1/9540A8240BC9 3 
  769.                                 3D1:77799/000000000000 3 
  770.                                 3RST:00000:00000:00000 3 
  771.                                 àÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄù 
  772.  
  773.  
  774.                                 úÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ 
  775. [MTH]           Breakpoint      3 1:00000  00          3 
  776.                 table screen    3 2:00000  00          3 
  777.                                 3 3:00000  00          3 
  778.                                 3 4:00000  00          3 
  779.                                 3 5:00000  00          3 
  780.                                 3 6:00000  00          3 
  781.                                 3 7:00000  00          3 
  782.                                 3 8:00000  00          3 
  783.                                 àÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄù 
  784.  
  785.  
  786.                                 úÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ 
  787. 059D1[PRG]1     Set             3°1:059D1°°00°°°°°°°°°°3 
  788.                 breakpoint 1    3 2:00000  00          3 
  789.                 at #59D1h       3 3:00000  00          3 
  790.                                 3 4:00000  00          3 
  791.                                 3 5:00000  00          3 
  792.                                 3 6:00000  00          3 
  793.                                 3 7:00000  00          3 
  794.                                 3 8:00000  00          3 
  795.                                 àÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄù 
  796.  
  797.  
  798.    The inverse bar in the display above indicates that the 
  799. breakpoint is set at the current PC. 
  800.  
  801.  
  802.                                 úÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ 
  803. [F]             Examine next    3@:059D1 P:0 CH ST:218 3 
  804.                 7 instructions  3 CALL.4 #0679B        3 
  805.                                 3 CALL.4 #06641        3 
  806.                                 3 MOVE.W A,R1          3 
  807.                                 3 CLR.A C              3 
  808.                                 3 MOVE.P1 #5,C         3 
  809.                                 3 CALL.3 #05B7D        3 
  810.                                 3 MOVE.W R1,C          3 
  811.                                 àÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄù 
  812.  
  813.  
  814. [MTH]           Back to breakpoint 
  815.                 table screen 
  816.  
  817.                                 úÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ 
  818. 06641[PRG]5     Set             3°1:059D1°°00°°°°°°°°°°3 
  819.                 breakpoint 5    3 2:00000  00          3 
  820.                 at #6641h       3 3:00000  00          3 
  821.                                 3 4:00000  00          3 
  822.                                 3 5:06641  00          3 
  823.                                 3 6:00000  00          3 
  824.                                 3 7:00000  00          3 
  825.                                 3 8:00000  00          3 
  826.                                 àÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄù 
  827.  
  828.  
  829.                                 úÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ 
  830. 040[+]          Single-step 64  3 1:059D1  00          3 
  831.                 instructions    3 2:00000  00          3 
  832.                 (remember that  3 3:00000  00          3 
  833.                 ARG is always   3 4:00000  00          3 
  834.                 entered in hex) 3°5:06641°+01°°°°°°°°°°3 
  835.                                 3 6:00000  00          3 
  836.                                 3 7:00000  00          3 
  837.                                 3 8:00000  00          3 
  838.                                 àÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄù 
  839.  
  840.  
  841.    We never really got as far as 64 instructions. Instead 
  842. we ran into the breakpoint at #6641h and stopped there, 
  843. with a "Breakpoint Stop" message appearing briefly. The 
  844. breakpoint table above tells us why we stopped, and that 
  845. it is our first stop here. Setting breakpoints and 
  846. single-stepping a large number of instructions is the 
  847. only way to use breakpoints in ROM. 
  848.  
  849.  
  850.                                 úÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ 
  851. [STO]5          Clear           3 1:059D1  00          3 
  852.                 breakpoint 5's  3 2:00000  00          3 
  853.                 counter         3 3:00000  00          3 
  854.                                 3 4:00000  00          3 
  855.                                 3°5:06641°°00°°°°°°°°°°3 
  856.                                 3 6:00000  00          3 
  857.                                 3 7:00000  00          3 
  858.                                 3 8:00000  00          3 
  859.                                 àÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄù 
  860.  
  861. More About Breakpoints 
  862. íííííííííííííííííííííí 
  863.  
  864.    A breakpoint is actually a CALL.A to an entry in the 
  865. MLDB. When the breakpoint is reached, control is 
  866. transfered to the breakpoint trap handler in the MLDB. It 
  867. finds the location of the breakpoint on the return stack 
  868. (RSTK), looks it up in the breakpoint table, and proceeds 
  869. as outlined above. Since a CALL.A instruction occupies 7 
  870. nibbles of memory, problems can arise when the program 
  871. contains a sequence like this: 
  872.  
  873.  
  874.         point:  brcc    foo             ; 3 nibbles 
  875.                 inc.a   c               ; 2 nibbles 
  876.         foo:    inc.a   c               ; 2 nibbles 
  877.                 dec.a   a               ; 2 nibbles 
  878.  
  879.  
  880.    Picture what would happen if a breakpoint is set at 
  881. `point.' It uses up 7 nibbles of memory, and thus 
  882. overwrites the BRCC, subsequent INC, and the INC at 
  883. `foo.' Assume another piece of the program makes a jump 
  884. to `foo.' This will result in a jump into the last two 
  885. nibbles of the breakpoint instruction! The program is 
  886. bound to behave erratically; if we're lucky this means 
  887. mysterious results, but if we're unlucky, the calculator 
  888. will crash and wipe its memory. 
  889.  
  890.    Here's how this problem is avoided. 
  891.  
  892.    During a [+] single-step of multiple instructions 
  893. (actually, any single-step with an ARG will do), the 
  894. breakpoints are never actually inserted into the program. 
  895. Instead, each consecutive PC is matched against the 
  896. breakpoint table, and if a breakpoint is set at exactly 
  897. that address, the single-stepping will stop. This usage 
  898. of breakpoints is entirely safe and works under all 
  899. conditions. It can, of course, be used for ROM as well as 
  900. RAM programs. The drawback is execution speed, although 
  901. the [-] stepping variant is usually faster than the [+] 
  902. variant. Graphics and other CPU-heavy applications take 
  903. seemingly forever to run. There is no simple solution - 
  904. you must take the 7-nibble limit into consideration when 
  905. writing such programs. Insert NOPs at places where you 
  906. know you will want to insert breakpoints. 
  907.  
  908.    The [-] single-step does not follow CALLs. It executes 
  909. the entire subroutine as if it were one single 
  910. instruction. When it returns, control returns to MLDB, 
  911. which then proceeds with the next instruction in 
  912. sequence, the one following the CALL. Time-consuming 
  913. functions like graphics routines can be placed in 
  914. separately debugged and verified subroutines, and the 
  915. main program calling these routines debugged with [-]. 
  916. This will generally shorten stepping time. 
  917.  
  918.    During [-] single-step, when a subroutine that is 
  919. allowed to run free returns or encounters a breakpoint, 
  920. the program halts. The return address *into* MLDB will be 
  921. on top of the return stack if it encountered a 
  922. breakpoint. Pressing [EVAL] to continue at this point 
  923. will cause the subroutine to continue running free, until 
  924. it again reaches a breakpoint or returns, at which point 
  925. it returns to MLDB and continues its [-] single-step. The 
  926. subroutine can also be single-stepped when it has 
  927. encountered a breakpoint, but *only* until it returns to 
  928. the caller, at which point it should be allowed to return 
  929. by pressing EVAL. 
  930. @@Watchpoints 
  931. Watchpoints 
  932. ííííííííííí 
  933.  
  934. The MLDB keeps track of watchpoints in the watchpoint 
  935. table, which consists of eight entries. Each entry can be 
  936. set to any arbitrary address, which will appear as a 
  937. memory dump line (described above) in the watchpoint 
  938. table screen (described above). By default, the addresses 
  939. are set to 00000. Watchpoints are useful for monitoring 
  940. memory contents. 
  941.  
  942. Watchpoints are accessed through the VAR key: 
  943.  
  944. VAR     If no ARG: switch to the watchpoint table screen. 
  945.  
  946. VAR     If ARG: set watchpoint. Expects a further key, 
  947.         1-8, which specifies the watchpoint to set. ARG 
  948.         is the new watchpoint address value. Watchpoints 
  949.         are cleared by setting them to 00000. 
  950. @@Options 
  951. Options 
  952. ííííííí 
  953.  
  954. There are three special options available, numbered 3, 4 
  955. and 5. 
  956.  
  957. Option 3 is used to switch to ASCII mode, which aids in 
  958. debugging programs that do any kind of text processing. 
  959. Since bytes take up two nibbles, ordinary even-address- 
  960. aligned memory dumps are not useful for examining ASCII 
  961. characters in memory when they happen to begin at odd 
  962. addresses. 
  963.  
  964. Option 4 toggles the alignment between even addresses 
  965. (the default) and odd. 
  966.  
  967. Option 5 toggles the automatic display of PICT during 
  968. program execution. 
  969.  
  970. Notice that since ASCII mode affects ARG entry and all 
  971. other integers displayed (except instructions), it is 
  972. only intended to be briefly toggled in and back out. The 
  973. same applies to the memory dump alignment shift. All 
  974. options are reset when the MLDB is initially invoked. 
  975.  
  976. The options are invoked with the CST key: 
  977.  
  978. CST 3    Toggle ASCII mode. All numerical data (except in 
  979.          instructions) will appear as 7-bit ASCII 
  980.          characters. Nonprintable characters appear as 
  981.          dots (.), and characters with the high bit set 
  982.          will appear in reverse video. 
  983.  
  984. CST 4    Toggle memory dump alignment. Affects only the 
  985.          memory dump; instead of the memory dump lines 
  986.          being evenly aligned, it will be oddly aligned, 
  987.          and vice versa. 
  988.  
  989. CST 5    Toggle automatic PICT display during program 
  990.          execution. 
  991. @@Server Modes 
  992. MLDB Server Modes 
  993. ííííííííííííííííí 
  994.  
  995. User flags 32 and 33 control the MLDB mode: 
  996.  
  997.  
  998.               3           Server,        Server, 
  999.          Flag 3 Local   Interactive     Protocol 
  1000.         ÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ 
  1001.           32  3 Clear       Set            Set 
  1002.           33  3 Clear      Clear           Set 
  1003.  
  1004.  
  1005.    The normal mode of operation, as described in the 
  1006. previous sections, is Local mode. The other two modes are 
  1007. referred to as Server Modes, and are: 
  1008.  
  1009. - Interactive Mode, in which commands (see Server Mode 
  1010. Commands, below) are entered on a dumb ASCII terminal or 
  1011. emulator with full editing (see Server Modes Command 
  1012. Entry, below); and 
  1013.  
  1014. - Protocol Mode, in which the same commands are accepted 
  1015. as in Interactive Mode, except no prompts are printed, 
  1016. and commands are not echoed during reception. The 
  1017. Protocol Mode is intended for communication with software 
  1018. on the development system. 
  1019.  
  1020.    You must set up I/O in the HP48 before invoking the 
  1021. MLDB in a server mode; see the HP48 manual for details. 
  1022. The MLDB server modes always communicate over the wire, 
  1023. effectively ignoring the state of system flag -33 (I/O 
  1024. device). 
  1025. @@Server Cmds 
  1026. MLDB Server Mode Commands 
  1027. ííííííííííííííííííííííííí 
  1028.  
  1029.    Commands can be entered in response to the ``*'' 
  1030. prompt in interactive mode. Commands can be sent at any 
  1031. time in protocol mode. Generally, excessive input is 
  1032. ignored, as are unrecognized commands or commands with 
  1033. invalid arguments. Command lines of up to 80 characters 
  1034. can be entered. Below is the list of the 18 recognized 
  1035. commands. The command name is first, and optional 
  1036. arguments are enclosed in square brackets. Don't type the 
  1037. brackets when entering the commands; they are used in the 
  1038. table merely to indicate that the argument is optional. 
  1039.  
  1040. = <addr>        Set the PC to <addr>. 
  1041.                 <addr> is in the range 00000-FFFFF. 
  1042.  
  1043. + <offs>        Add <offs> to PC. 
  1044.                 <offs> is in the range 00000-FFFFF. 
  1045.  
  1046. - <offs>        Subtract <offs> from PC. 
  1047.                 <offs> is in the range 00000-FFFFF. 
  1048.  
  1049. n [<n>]         Advance PC forward <n> instructions. If 
  1050.                 no <n> is supplied, the PC is advanced 
  1051.                 one instruction. 
  1052.  
  1053. s [<n>]         Single-step <n> instructions. Same as the 
  1054.                 [+] key in Local Mode. If no <n> is 
  1055.                 entered, one instruction is stepped. A 
  1056.                 single-step of more than one instruction 
  1057.                 can be interrupted by pressing any key, 
  1058.                 which is ignored. 
  1059.  
  1060. S [<n>]         Single-step <n> instrutions, but don't 
  1061.                 follow CALLs. Same as the [-] key in 
  1062.                 Local Mode. If no <n> is entered, one 
  1063.                 instruction or CALL is is stepped. A 
  1064.                 single-step of more than one instruction 
  1065.                 can be interrupted by pressing any key, 
  1066.                 which is ignored. 
  1067.  
  1068. c               Continue free-run execution until the 
  1069.                 program completes or a breakpoint is 
  1070.                 encountered. When the program completes, 
  1071.                 "Exit" is printed and MLDB exits. 
  1072.  
  1073. t               Terminate. Exit with current registers. 
  1074.  
  1075. T               Terminate. Exit with system registers set 
  1076.                 up exactly as they were when MLDB was 
  1077.                 invoked. 
  1078.  
  1079. R               Reset. 
  1080.  
  1081. r               Print registers. The HEX/DEC mode is 
  1082.                 printed as "HD:0" or "HD:1". A zero means 
  1083.                 that HEX mode is active, a one means that 
  1084.                 DEC mode is active. 
  1085.  
  1086. i [<n>] [<addr>] 
  1087.                 Print instructions. <n> instructions are 
  1088.                 printed, starting at <addr>. The first 
  1089.                 argument is always <n> and the second is 
  1090.                 <addr>. If no <addr> is entered, the 
  1091.                 current PC is assumed. If <n> isn't 
  1092.                 entered, one (the next) instruction is 
  1093.                 printed. <n> and <addr> are both in the 
  1094.                 range 00000-FFFFF. 
  1095.  
  1096. x [<n>] [<addr>] 
  1097.                 Print memory contents. <n> words of 16 
  1098.                 nibbles are printed, starting at <addr>, 
  1099.                 each on a separate line. The first 
  1100.                 argument is always <n> and the second is 
  1101.                 <addr>. If no <addr> is entered, the 
  1102.                 current PC is assumed. If <n> isn't 
  1103.                 entered, one (the next) word is printed. 
  1104.                 <n> and <addr> are both in the range 
  1105.                 00000-FFFFF. 
  1106.  
  1107. a [<n>] [<addr>] 
  1108.                 Print memory contents in ASCII. <n> words 
  1109.                 of 32 nibbles are printed as ASCII 
  1110.                 characters, starting at <addr>, each 
  1111.                 consecutive word on a separate line. The 
  1112.                 first argument is always <n> and the 
  1113.                 second is <addr>. If no <addr> is 
  1114.                 entered, the current PC is assumed. If 
  1115.                 <n> isn't entered, one (the next) word is 
  1116.                 printed. <n> and <addr> are both in the 
  1117.                 range 00000-FFFFF. 
  1118.  
  1119. z               Print the return stack (the RSTK). 
  1120.  
  1121. db <n> [<addr>] Set breakpoint <n> at <addr>. If <addr> 
  1122.                 is absent, the breakpoint is cleared. 
  1123.                 <addr> is in the range 00000-FFFFF. <n> 
  1124.                 must be in the range 1-8. 
  1125.  
  1126. hb <n> [<cntr>] Set breakpoint <n> counter to <cntr>. If 
  1127.                 <cntr> is absent, the counter is set to 
  1128.                 00. <cntr> is in the range 00-FF. 
  1129.                 <n> must be in the range 1-8. 
  1130.  
  1131. lb              List breakpoints. 
  1132. @@Cmd Entry 
  1133. MLDB Server Modes Command Entry 
  1134. ííííííííííííííííííííííííííííííí 
  1135.  
  1136.    In both Interactive and Protocol Modes, input can be 
  1137. edited, although no echo or response can be detected in 
  1138. Protocol Mode. The following table may be of help when 
  1139. you try to locate the editing keys on your keyboard. 
  1140. After 80 characters have been typed, any further entry 
  1141. (except the editing keys listed below) is ignored. 
  1142.  
  1143.  
  1144. Backspace, Delete,      Erase the last character entered. 
  1145. or Rubout 
  1146.  
  1147. Control-W               Erase the last word entered. 
  1148.  
  1149. Control-U or            Erase the entire line. 
  1150. Control-X 
  1151.  
  1152. Control-R               Rewrite input. 
  1153.  
  1154. Return, Enter, or       Execute command entered. 
  1155. Control-M 
  1156.  
  1157.  
  1158. Example, An MLDB Interactive Mode Session 
  1159. ííííííííííííííííííííííííííííííííííííííííí 
  1160.  
  1161. Connect the HP48 to your dumb terminal or computer. 
  1162.  
  1163. Type this into the HP48's command line and then press 
  1164. ENTER: 
  1165.  
  1166. 1  2  #3223h  MLDB 
  1167.  
  1168. First, we are greeted with a header: 
  1169.  
  1170.     MLDL 1.06A 
  1171.     Copyright (c) 1991 Jan Brittenson 
  1172.  
  1173. We will now watch SWAP work on the 1 and 2 on the stack. 
  1174.  
  1175. Note, however, that in reality output will rarely 
  1176. resemble the perfection of this example, because here we 
  1177. "just happened" to know in advance the number of 
  1178. instructions to be listed, which almost never happens in 
  1179. real-world debugging sessions. 
  1180.  
  1181. Let's first take a look at the SWAP PMC by typing the 
  1182. command shown after the "*" prompt: 
  1183.  
  1184.         * i 9 
  1185.         MOVE.A @D1,C 
  1186.         ADD.A #5,D1 
  1187.         MOVE.A @D1,A 
  1188.         MOVE.A C,@D1 
  1189.         SUB.A #5,D1 
  1190.         MOVE.A A,@D1 
  1191.         MOVE.A @D0,A 
  1192.         ADD.A #5,D0 
  1193.         JUMP.A @A 
  1194.  
  1195. Then the registers: 
  1196.  
  1197.         * r 
  1198.         CY:0 
  1199.         P:0 
  1200.         PC:03228 
  1201.         A:0000000644403223 
  1202.         B:0960000000074FB3 
  1203.         C:0000000000075FBB 
  1204.         D:0000000000000335 
  1205.         R0:000000000007BCA5 
  1206.         R1:0000000644403228 
  1207.         R2:00000000000505C6 
  1208.         R3:0000000644400001 
  1209.         R4:00015074EE274F20 
  1210.         D0:7C1A5 
  1211.         D1:75FC0 
  1212.         ST:000 
  1213.         HST:2 
  1214.         HD:0 
  1215.  
  1216. So stack level 1 is at 75FC0. Examine level 1. 
  1217.  
  1218.         * x 1 75fc0 
  1219.         75FC0:ED2A29C2A2000000 
  1220.  
  1221. Which is object 2A2DE. Examine this object. 
  1222.  
  1223.         * x 2 2a2de 
  1224.         2A2DE:3392000000000000 
  1225.         2A2EE:0002033920000000 
  1226.  
  1227. Which is a real (type prefix 2933), the constant 2. Let's 
  1228. step a few instructions. 
  1229.  
  1230.         * i 
  1231.         MOVE.A @D1,C 
  1232.         * s 
  1233.         * i 
  1234.         ADD.A #5,D1 
  1235.         * s 
  1236.         * i 
  1237.         MOVE.A @D1,A 
  1238.         * s 
  1239.         * i 
  1240.         MOVE.A C,@D1 
  1241.         * s 
  1242.         * i 
  1243.         SUB.A #5,D1 
  1244.         * s 
  1245.         * i 
  1246.         MOVE.A A,@D1 
  1247.         * s 
  1248.  
  1249. Now, what do we have left of the SWAP PMC? 
  1250.  
  1251.         * i 3 
  1252.         MOVE.A @D0,A 
  1253.         ADD.A #5,D0 
  1254.         JUMP.A @A 
  1255.  
  1256. Finally, we step a goodly chunk of instructions. That way 
  1257. we can be sure that the program completes. 
  1258.  
  1259.         * s 100 
  1260.         Exit 
  1261.  
  1262. We're done. The HP-48 stack now reads "2" in level 2, and 
  1263. "1" in level 1. 
  1264. @@Messages 
  1265. Messages 
  1266. íííííííí 
  1267.  
  1268. Stopped 
  1269.  
  1270.     Appears for about a second at the top of the screen. 
  1271.     Indicates that a single-step of multiple instructions 
  1272.     was interrupted by pressing the ON key. 
  1273.  
  1274. Breakpoint Stop 
  1275.  
  1276.     Appears for about a second at the top of the screen. 
  1277.     Indicates that a single-step of multiple instructions 
  1278.     encountered a breakpoint. 
  1279.  
  1280. Breakpoint Trap 
  1281.  
  1282.     Appears for about a second at the top of the screen. 
  1283.     Indicates that the program encountered a breakpoint 
  1284.     during free run. This can occur either during a CALL 
  1285.     executed with the [-] key or a free run initiated 
  1286.     with the EVAL key. 
  1287.  
  1288. Fatal Error: 
  1289. Data Lost 
  1290.  
  1291.     Indicates that the 'MLDLpar' variable was corrupted 
  1292.     or purged, either directly or indirectly, by the 
  1293.     program being debugged. No recovery is possible. 
  1294.     Press any key to reset (same as ON-C). 
  1295.  
  1296. Fatal Error: 
  1297. ROM Card Failure 
  1298.  
  1299.     Indicates that an attempt was made to use the "B" 
  1300.     version of the MLDL from a write-enabled RAM card. 
  1301.     Press any key to reset, then either (a) switch the 
  1302.     RAM card to write-protected, (b) burn it into an OTP, 
  1303.     EPROM, or the like, and run it from there, or (c) 
  1304.     purge the MLDL and replace it with the "A" version 
  1305.     which does run in write-enabled RAM cards. 
  1306.  
  1307. Fatal Error: 
  1308. RAM Card Failure 
  1309.  
  1310.     Indicates that an attempt was made to use the "A" 
  1311.     version of the MLDL from a write-protected RAM card, 
  1312.     OTP, EPROM, or the like. Press any key to reset, then 
  1313.     either (a) switch the RAM card to write-enabled, or 
  1314.     (b) purge the MLDL and replace it with the "B" 
  1315.     version which does run in write-protected RAM cards, 
  1316.     OTPs, EPROMs, and the like. 
  1317. @@Warnings 
  1318. Some MLDB System Considerations 
  1319. ííííííííííííííííííííííííííííííí 
  1320.  
  1321.    The debugger (MLDB) has been designed in such a way 
  1322. that it will not alter any static system data or depend 
  1323. on the precise machine configuration (assuming that the 
  1324. automatic displaying of PICT has been disabled). The only 
  1325. system data it modifies is the keyboard buffer, since it 
  1326. relies on the system to respond to the keyboard interrupt 
  1327. and manage the buffer. Testing has shown that 
  1328. interfering with this results in poor reliability. Still, 
  1329. there are three instructions the debugger will refuse to 
  1330. single-step: 
  1331.  
  1332.  
  1333. RESET 
  1334.           The effect of this would be the same as ON-C. 
  1335.  
  1336. CLRB #F,ST 
  1337.  
  1338.           Executing this instruction would lock up your 
  1339.           calculator since it would disable all I/O, most 
  1340.           notably the keyboard. 
  1341.  
  1342. INTOFF 
  1343.           This would also lock up the keyboard. 
  1344.  
  1345.    Apart from the aspects outlined above and some system 
  1346. RPL code to do argument type checking, the debugger is 
  1347. self-contained. 
  1348.  
  1349.  
  1350. A Word of Caution 
  1351. ííííííííííííííííí 
  1352.  
  1353.    The [-] key lets you complete an entire CALL. But 
  1354. beware: the return stack is replaced by one that will 
  1355. cause the called routine to return to the debugger. 
  1356. Therefore the routine called cannot rely on specific 
  1357. return stack contents, or remove return addresses from 
  1358. the stack, either of which will invariably result in a 
  1359. system crash. One example of a ROM routine that actually 
  1360. does this is 0CD8E, which jumps to a location in the 
  1361. bank-switched ROM usually hidden behind user RAM. Most of 
  1362. the trig and log functions are actually located in this 
  1363. hidden ROM. 
  1364.  
  1365. Despite the effort put into avoiding system collisions, 
  1366. the HP48 still remains a largely unprotected system. 
  1367. The debugger - or other parts of the MLDL - can still be 
  1368. overwritten, which may result in memory loss. Since the 
  1369. MLDL is stored as a library in a port, it is not 
  1370. susceptible to general memory allocation, such as dynamic 
  1371. memory allocation or system display GROB allocations. On 
  1372. the other hand, storing another library in the same port 
  1373. may cause it to move - extreme caution is therefore 
  1374. advisable when single-stepping PMC that alters stored 
  1375. port data. If you are stepping a port store block copy by 
  1376. means of either [+] or [-], then the MLDL may be 
  1377. overwritten. If you're using [-] to call a block copy 
  1378. routine within a similar context, then the library may 
  1379. have moved and the subsequent return will cause a system 
  1380. crash and possibly memory corruption. 
  1381.  
  1382.    Single-stepping a machine code program is in no way 
  1383. less dangerous than allowing it to run uncontrolled. It 
  1384. merely gives you some control over what happens between 
  1385. instructions. It can even be more dangerous; hardware may 
  1386. break if left in certain configurations for a period of 
  1387. time, which may be a fraction of a second (most notably 
  1388. the LCD and the IR LED). So if you are going to 
  1389. single-step parts of the system ROM, you should be aware 
  1390. of this risk, although the author at this time has never 
  1391. actually heard of this occurring. In no way will the 
  1392. author or distributors of the MLDL or anybody else accept 
  1393. any responsibility or liability for such damage, 
  1394. regardless of its nature and extent. 
  1395.  
  1396.    The MLDL is distributed in the hope that it will be 
  1397. useful, but WITHOUT ANY WARRANTY; without even the 
  1398. implied warranty of MERCHANTABILITY or FITNESS FOR A 
  1399. PARTICULAR PURPOSE. 
  1400. @@MLPR========= 
  1401. [MLPR] ================================================== 
  1402.  
  1403. Disassembles and prints ML programs, non-stop until 
  1404. interrupted. Accepts the same arguments as MLDB, except 
  1405. @#3a81 and #3ac0 which are not recognized. The program is 
  1406. printed to the current print device, IR or wire. In case 
  1407. of problems, first check your PRTPAR - see your HP48 
  1408. manual for details. 
  1409.  
  1410. Each printed line consists of a mnemonic preceded by the 
  1411. address. No opcode is included, since it normally is of 
  1412. little interest. 
  1413.  
  1414. MLPR is not too intelligent; it disassembles starting at 
  1415. the address specified (or at the beginning of the code 
  1416. onject) onward until you press ON to stop it. ML1 
  1417. (described below) can be used to build your own custom 
  1418. disassembler with more intelligence. Due to this 
  1419. limitation, MLPR is not really suitable to be called from 
  1420. a program. Its intended use is to quickly list machine 
  1421. code on a printer or to the serial port. If passed a code 
  1422. object, the code object should not reside in TEMPOB; 
  1423. store it in a variable and recall it before invoking 
  1424. MLPR. 
  1425. @@ML1========== 
  1426. [ML1] =================================================== 
  1427.  
  1428.    Disassembles one ML instruction; allows you to build 
  1429. your own disassemblers with its own special-purpose user 
  1430. interface. It takes a binary integer in level one, and 
  1431. returns two values; in level 2 the mnemonic form preceded 
  1432. by the address, and in level one the address of the next 
  1433. instruction. Thus it is a simple task to make a number of 
  1434. consecutive calls to ML1. MLOPC (described below) can be 
  1435. used to extract the opcode as a string of hexadecimal 
  1436. digits. Extracting the mnemonic from the string is 
  1437. trivial, since it will always be of the form: 
  1438.  
  1439.         "xxxxx: m" 
  1440.  
  1441. where xxxxx is a five-digit address followed by a colon 
  1442. and a blank. The last part of the string, m, is the 
  1443. mnemonic. 
  1444. @@MLOPC======== 
  1445. [MLOPC] ================================================= 
  1446.  
  1447.    Returns opcode as a string of hexadecimal digits. 
  1448. Expects two binary integers - the first address in level 
  1449. 2 and the final address plus one in level 1. Useful for 
  1450. creating the opcode field in a custom disassembler. 
  1451. Example, MLOPC: 
  1452.  
  1453.         #59D1 #59D7 MLOPC  -->  "8E4CD0" 
  1454.  
  1455. The opcode size is limited to 255 digits. 
  1456. @@Cmd Summary 
  1457. MLDL COMMAND SUMMARY 
  1458. íííííííííííííííííííí 
  1459.  
  1460. úÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ 
  1461. 3                                                       3 
  1462. 3 ABOUTMLDL     Displays version and copyright screen   3 
  1463. 3                                                       3 
  1464. ~AÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ' 
  1465. 3                                                       3 
  1466. 3 MLDB          Saturn Machine Language Debugger        3 
  1467. 3                                                       3 
  1468. 3                       obj     --> any1 ... anyN       3 
  1469. 3                                                       3 
  1470. ~AÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ' 
  1471. 3                                                       3 
  1472. 3 MLPR          Print Machine Language Program          3 
  1473. 3                                                       3 
  1474. 3                       obj     --> obj                 3 
  1475. 3                                                       3 
  1476. ~AÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ' 
  1477. 3                                                       3 
  1478. 3 ML1           Single-Instruction ML Disassembler      3 
  1479. 3                                                       3 
  1480. 3                     #address  --> "instruction" #next 3 
  1481. 3                                                       3 
  1482. ~AÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ' 
  1483. 3                                                       3 
  1484. 3 MLOPC         Machine Language Instruction Opcode     3 
  1485. 3                                                       3 
  1486. 3          #address1 #address2  --> "hex digits"        3 
  1487. 3                                                       3 
  1488. àÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄù 
  1489. @@Kbd Summary 
  1490. MLDB LOCAL MODE KEYBOARD SUMMARY 
  1491. íííííííííííííííííííííííííííííííí 
  1492.  
  1493. Screens         No ARG                  ARG 
  1494. ÄÄÄÄÄÄÄ         ÄÄÄÄÄÄÄÄÄÄ              ÄÄÄÄÄÄÄÄÄÄÄÄ 
  1495.  
  1496. [A]             General CPU State 
  1497. [B]             Arithmetic registers 
  1498. [C]             Data registers 
  1499. [D]             Return stack (RSTK) 
  1500. [E]             Memory dump 
  1501. [F]             Instruction stream 
  1502. [MTH]           Breakpoint table        Breakpoint table 
  1503.  
  1504. ARG entry 
  1505.  
  1506. [0]             Begins ARG entry 
  1507. 0-9, A-F        Hex digits 
  1508. [+/-]           2's complement 
  1509. [<==]           Shift right one digit 
  1510. [DEL]           Cancel 
  1511.  
  1512. Moving around 
  1513.  
  1514. [ENTER]         Ignored                 PC=ARG 
  1515. [left]          PC=PC-1                 PC=PC-ARG 
  1516. [right]         PC=PC+1                 PC=PC+ARG 
  1517. [up]            PC=PC-16                PC=PC-16*ARG 
  1518. [down]          PC=PC+16                PC=PC+16*ARG 
  1519. [x]             MARK=PC                 MARK=ARG 
  1520. [+/-]           MARK <-> PC             MARK <-> PC 
  1521. [NXT]           Advance one             Advance ARG 
  1522.                 instruction             instructions 
  1523.  
  1524. Breakpoints (b = 1 - 8) 
  1525.  
  1526. [MTH]           Breakpoint table        Breakpoint table 
  1527.                 screen                  screen 
  1528.  
  1529. [PRG]b          Clear breakpoint b      Set breakpoint b 
  1530.                 address & counter       address to ARG 
  1531.  
  1532. [STO]b          Clear breakpoint b      Set breakpoint b 
  1533.                 counter                 counter to ARG 
  1534.  
  1535. Program execution 
  1536.  
  1537. [+]             Single-step one         Single-step ARG 
  1538.                 instruction             instructions 
  1539.  
  1540. [-]             Single-step one         Single-step ARG 
  1541.                 instruction, do         instructions; do 
  1542.                 not follow CALLs        not follow CALLs 
  1543.  
  1544. [EVAL]          Let program run until   Ignored 
  1545.                 completed, or until 
  1546.                 breakpoint 
  1547. @@XLIB numbers 
  1548. MLDL XLIB TABLE 
  1549. ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ 
  1550.  
  1551. The library number is 444 hexadecimal, which is 1092 
  1552. decimal. 
  1553.  
  1554.  
  1555.         Command         Number 
  1556.         ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ 
  1557.         Version         1092 0 
  1558.         MLDB            1092 1 
  1559.         MLPR            1092 2 
  1560.         ML1             1092 3 
  1561.         MLOPC           1092 4 
  1562.